Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement CompilerDesugaringKind enum #43832

Merged
merged 2 commits into from
Aug 18, 2017

Conversation

huntiep
Copy link
Contributor

@huntiep huntiep commented Aug 13, 2017

This is the first step outlined in #35946. I think that the variants of CompilerDesugaringKind should be changed, I didn't know what the official names for ... and <- are.

I'm not to sure how tests for the compiler work, but I would imagine that tests should be added such that
Symbol::intern(s) == CompilerDesugaringKind::from(s).as_symbol() for valid s.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@huntiep huntiep mentioned this pull request Aug 13, 2017
@@ -397,11 +397,12 @@ impl<'a> LoweringContext<'a> {
}

fn allow_internal_unstable(&self, reason: &'static str, mut span: Span) -> Span {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it make sense to directly pass the enum as an argument here?

@carols10cents carols10cents added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 14, 2017
@carols10cents
Copy link
Member

Hi! Thanks for the pull request! We'll be checking in periodically to make sure @nikomatsakis or someone else reviews this.

Copy link
Contributor

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is in the right direction, but not quite what I had in mind. Please do let me know if my suggestion doesn't make sense or needs clarification!

}
}

impl<'a> From<&'a str> for CompilerDesugaringKind {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somewhat along the lines of what @oli-obk was suggesting, I didn't expect to have CompiledDesugaringKind::from, but rather replace all places in the compiler where we use constant strings with direct references to the enum variants, and instead invoke as_symbol() anywhere that we need to print things out.

@nikomatsakis
Copy link
Contributor

Also, I apologize for delay, I was on vacation!

@huntiep
Copy link
Contributor Author

huntiep commented Aug 16, 2017

It's not a problem, I was also on vacation until recently.

@nikomatsakis
Copy link
Contributor

@bors r+ -- looks good!

@bors
Copy link
Contributor

bors commented Aug 17, 2017

📌 Commit ff047a8 has been approved by nikomatsakis

@bors
Copy link
Contributor

bors commented Aug 17, 2017

⌛ Testing commit ff047a8 with merge 03444c3f89265be27e9ea4929b38a548b8b321bc...

@bors
Copy link
Contributor

bors commented Aug 17, 2017

💔 Test failed - status-travis

@kennytm
Copy link
Member

kennytm commented Aug 17, 2017

@bors retry #43283 (arm-android)

This seems to become more frequent recently 🤔

@bors
Copy link
Contributor

bors commented Aug 18, 2017

⌛ Testing commit ff047a8 with merge 4ac7646...

bors added a commit that referenced this pull request Aug 18, 2017
Implement CompilerDesugaringKind enum

This is the first step outlined in #35946. I think that the variants of `CompilerDesugaringKind` should be changed, I didn't know what the official names for `...` and `<-` are.

I'm not to sure how tests for the compiler work, but I would imagine that tests should be added such that
`Symbol::intern(s) == CompilerDesugaringKind::from(s).as_symbol()` for valid `s`.
@bors
Copy link
Contributor

bors commented Aug 18, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: nikomatsakis
Pushing 4ac7646 to master...

@bors bors merged commit ff047a8 into rust-lang:master Aug 18, 2017
@huntiep huntiep deleted the compiler-desugaring-enum branch August 19, 2017 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants